<template>
	<view class="notice-content">
		<view class="item-box" v-for="(item,index) in noticeList" :key="index" @click="handleToNote(item)">
			<view class="content">
				<view class="title">
					<text>{{item.noticeTitle}}</text>
				</view>
				<text class="time">{{item.createTime}}</text>
			</view>

		</view>
	</view>
</template>

<script>
	import { listNotice } from "@/api/system/notice"
	
	export default {
		data() {
			return{
				noticeList: null,
				noticeTitle: null,
				noticeContent: null,
			}
		},
		onLoad:function() {
			this.getNotice();
		},
		methods: {
			getNotice(e) {
				listNotice().then(response =>{
					this.noticeList = response.rows 
					// console.log(this.noticeList)
				})
			},
			handleToNote(item) {
					  // console.log(item)
					  this.noticeTitle = item.noticeTitle
					  this.noticeContent = item.noticeContent
					  this.$tab.navigateTo(`/pages/work/function/note/index?title=${this.noticeTitle}&content=${this.noticeContent}`)
			}
		}
	}
</script>

<style>
	page {
	  display: flex;
	  flex-direction: column;
	  box-sizing: border-box;
	  background-color: #fff;
	  min-height: 100%;
	  height: auto;
	}
	
	view {
	  font-size: 14px;
	  line-height: inherit;
	}
	
	.content{
/* 		margin: 10px; */
		padding: 10px;
		border-bottom: 0.5px solid gray;
	}
	
	.title{
		height: 20px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	
	.time{
		font-size: 10px;
		color: gray;
		text-align: right;
	}
</style>